package com.cssl.controller;

import com.cssl.openFeign.DtsCouponClient;
import com.cssl.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/coupon")
@Api(value = "优惠券接口",tags = "优惠券相关操作")
public class DtsCouponController {

    @Resource
    private DtsCouponClient couponClient;

    /**
     * 首页优惠券展示
     * @return
     */
    @PostMapping("/homePageCoupon")
    @ApiOperation(value = "首页优惠券展示",tags = "首页优惠券")
    public Result homePageCoupon(){
        return couponClient.homePageCoupon();
    }


    @PostMapping("/getUserCoupOn")
    @ApiOperation(value = "获得用户所有的优惠券",tags = "用户优惠券")
    public Result getUserCoupOn(){
        return couponClient.getUserCoupOn();
    }
}
